package com.ruoyi.system.order.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

/**
 * 售后协商历史表
 * @TableName after_sale_history
 */
@TableName(value ="after_sale_history")
public class AfterSaleHistory implements Serializable {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 关联售后单ID
     */
    private Long afterSaleId;

    /**
     * 操作方（1-买家，2-商家，3-系统）
     */
    private Integer operatorType;

    /**
     * 操作人ID（系统可为空）
     */
    private Long operatorId;

    /**
     * 操作动作（1-发起退款，2-同意退款，3-拒绝退款，4-退款成功）
     */
    private Integer action;

    /**
     * 原因（如拒绝原因、退款原因等）
     */
    private String reason;

    /**
     * 补充说明
     */
    private String extra;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 主键ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 关联售后单ID
     */
    public Long getAfterSaleId() {
        return afterSaleId;
    }

    /**
     * 关联售后单ID
     */
    public void setAfterSaleId(Long afterSaleId) {
        this.afterSaleId = afterSaleId;
    }

    /**
     * 操作方（1-买家，2-商家，3-系统）
     */
    public Integer getOperatorType() {
        return operatorType;
    }

    /**
     * 操作方（1-买家，2-商家，3-系统）
     */
    public void setOperatorType(Integer operatorType) {
        this.operatorType = operatorType;
    }

    /**
     * 操作人ID（系统可为空）
     */
    public Long getOperatorId() {
        return operatorId;
    }

    /**
     * 操作人ID（系统可为空）
     */
    public void setOperatorId(Long operatorId) {
        this.operatorId = operatorId;
    }

    /**
     * 操作动作（1-发起退款，2-同意退款，3-拒绝退款，4-退款成功）
     */
    public Integer getAction() {
        return action;
    }

    /**
     * 操作动作（1-发起退款，2-同意退款，3-拒绝退款，4-退款成功）
     */
    public void setAction(Integer action) {
        this.action = action;
    }

    /**
     * 原因（如拒绝原因、退款原因等）
     */
    public String getReason() {
        return reason;
    }

    /**
     * 原因（如拒绝原因、退款原因等）
     */
    public void setReason(String reason) {
        this.reason = reason;
    }

    /**
     * 补充说明
     */
    public String getExtra() {
        return extra;
    }

    /**
     * 补充说明
     */
    public void setExtra(String extra) {
        this.extra = extra;
    }

    /**
     * 创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AfterSaleHistory other = (AfterSaleHistory) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getAfterSaleId() == null ? other.getAfterSaleId() == null : this.getAfterSaleId().equals(other.getAfterSaleId()))
            && (this.getOperatorType() == null ? other.getOperatorType() == null : this.getOperatorType().equals(other.getOperatorType()))
            && (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId()))
            && (this.getAction() == null ? other.getAction() == null : this.getAction().equals(other.getAction()))
            && (this.getReason() == null ? other.getReason() == null : this.getReason().equals(other.getReason()))
            && (this.getExtra() == null ? other.getExtra() == null : this.getExtra().equals(other.getExtra()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getAfterSaleId() == null) ? 0 : getAfterSaleId().hashCode());
        result = prime * result + ((getOperatorType() == null) ? 0 : getOperatorType().hashCode());
        result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode());
        result = prime * result + ((getAction() == null) ? 0 : getAction().hashCode());
        result = prime * result + ((getReason() == null) ? 0 : getReason().hashCode());
        result = prime * result + ((getExtra() == null) ? 0 : getExtra().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", afterSaleId=").append(afterSaleId);
        sb.append(", operatorType=").append(operatorType);
        sb.append(", operatorId=").append(operatorId);
        sb.append(", action=").append(action);
        sb.append(", reason=").append(reason);
        sb.append(", extra=").append(extra);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}